/*
 * jjann.h
 *
 *  Created on: Sep 4, 2013
 *      Author: Alan
 */

#ifndef JJANN_H_
#define JJANN_H_

#include <stddef.h>

#include "types.h"
#include "datastructures.h"
#include "activation.h"
//#include "topology.h"

/**
 * Create a new network  with the specified settings
 */
netdata_t* initNetwork(const int8* settingsFileName);

void destroyNetwork(netdata_tp net);
/**
 * Computes the output of the network
 */
void feedForward(netdata_tp net, float32* inputs, float32* outputs);
/**
 * Save the net weights to a file
 */
void save(netdata_tp net, int8* fileName);
/**
 * Restores the weights from a file, the net has to be created first with initNetwork
 */
void load(netdata_tp net, int8* fileName);

//////////////////////////////////////////////////////////
// FUNCTION WHICH SHOULD NOT BE USED BY THE USERS
/////////////////////////////////////////////////////////$
netdata_tp initFullyConnectedNetwork(uint32 inputs, uint32 hidden, uint32 output, float32 (*huaf)(netdata_tp, float32 x), float32 (*dhuaf)(netdata_tp, float32 x), float32 (*ouaf)(netdata_tp, float32 x), float32 (*douaf)(netdata_tp, float32 x), float32 (*errorComputation)(float32 *output, float32 *target, size_t size), settings_tp settings);

neuron_t* getNeuron(netdata_t* net, uint32 i, uint32 j);
void debugMatrix(netdata_t* net);
void reserveNetSpace(netdata_tp originalNet, netdata_tp newNet);
void copy(netdata_tp src, netdata_tp dst);
void copyNeuron(neuron_tp src, neuron_tp dst, netdata_tp dstNet);

#endif /* JJANN_H_ */
